/**
 * --- 测试用例 ---
 * 
 * 输入：
 * `Accept-Ranges: bytes 
 * Cache-Control: max-age=6000, public
 * Connection: keep-alive
 * Content-Type: application/javascript`
 * 
 * 输出：
 * {
 *   "Accept-Ranges": "bytes",
 *   "Cache-Control": "max-age=6000, public",
 *   Connection: "keep-alive",
 *   "Content-Type": "application/javascript"
 * }
 */

const solution = (s) => {
    const res = {};
    const arr = s.split('\n');
    arr.forEach((item)=> {
        let temp = item.split(':');
        res[temp[0]] = temp[1];
    })
    return res;
}

const s = `Accept-Ranges: bytes 
Cache-Control: max-age=6000, public
Connection: keep-alive
Content-Type: application/javascript`;

console.log(solution(s));
